/*
 * Copyright 2011 Shotaro Uchida <fantom@xmaker.mx>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jazzkaffe;

/**
 * NodeDescriptor, part of the ZigBee Application Framework.
 * ZigBee Specification (Document 053474r17) 2.3.2.3
 * 
 * @author Shotaro Uchida <fantom@xmaker.mx>
 */
public interface ZigBeeNodeDescriptor {

    public static final byte LOGICAL_TYPE_COORDINATOR = 0x0;
    public static final byte LOGICAL_TYPE_ROUTER = 0x1;
    public static final byte LOGICAL_TYPE_END_DEVICE = 0x2;

    public byte getLogicalType();

//    public boolean isComplexDescriptorAvailable();

//    public boolean isUserDescriptorAvailable();

    public byte getAPSFlags();
    
    public static final byte FREQUENCY_868_TO_868_6 = 0x1 << 0;
    public static final byte FREQUENCY_902_TO_928 = 0x1 << 2;
    public static final byte FREQUENCY_2400_TO_2483_5 = 0x1 << 3;

    public byte getFrequencyBand();
    
    public static final byte MAC_CAP_ALTERNATE_PAN_COORDINATOR = 0x01;
    public static final byte MAC_CAP_DEVICE_TYPE = 0x02;
    public static final byte MAC_CAP_POWER_SOURCE = 0x04;
    public static final byte MAC_CAP_RECEIVER_ON_WHEN_IDLE = 0x08;
    public static final byte MAC_CAP_SECURITY_CAP = 0x40;
    public static final byte MAC_CAP_ALLOCATE_ADDRESS = (byte) 0x80;

    public byte getMACCapabilityFlags();

    public short getManufacturerCode();

    public byte getMaximumBufferSize();

    public short getMaximumIncomingTransferSize();
    
    public static final short SERVER_MASK_PRIMARY_TRUST_CENTER = 0x1 << 0;
    public static final short SERVER_MASK_BACKUP_TRUST_CENTER = 0x1 << 1;
    public static final short SERVER_MASK_PRIMARY_BINDING_TABLE_CACHE = 0x1 << 2;
    public static final short SERVER_MASK_BACKUP_BINDING_TABLE_CACHE = 0x1 << 3;
    public static final short SERVER_MASK_PRIMARY_DISCOVERY_CACHE = 0x1 << 4;
    public static final short SERVER_MASK_BACKUP_DISCOVERY_CACHE = 0x1 << 5;
    public static final short SERVER_MASK_NETWORK_MANAGER = 0x1 << 6;

    public short getServerMask();

    public short getMaximumOutgoingTransferSize();
    
    public static final byte DESCRIPTOR_CAP_EXT_ACTIVE_EP_LIST_AVAILABLE = 0x01 << 0;
    public static final byte DESCRIPTOR_CAP_EXT_SIMPLE_EP_LIST_AVAILABLE = 0x01 << 1;

    public byte getDescriptorCapability();
}
